import request from '@/utils/request'
import axios from 'axios'

// 查询订单列表
export function listOrders(query) {
  return request({
    url: '/orders/list',
    method: 'get',
    params: query
  })
}

// 初始化订单列表 将订单列表上传到缓存中
export function initOrders() {
  return request({
    url: '/orders/init',
    method: 'get',
  })
}

export function findFreeRooms() {
  return request({
    url: '/orders/freeRooms',
    method: 'get',
  })
}

export function addRoomOrder(date) {
  return request({
    url: '/orders/add',
    method: 'post',
    data: date
  });
}

export function addBill(date) {
  return request({
    url: '/bill/add',
    method: 'post',
    data: date
  });
}

export function updateOrderStatus(date) {
  return request({
    url: '/orders/updateOrderStatus',
    method: 'put',
    params: date
  });
}

export function deleteOrderById(date) {
  return request({
    url: '/orders/deleteOrder',
    method: 'delete',
    params: date
  });
}